import { PropType } from 'vue'
import { OperButton } from './dHeader'
//分页栏类型
export type pageElement='sizes'|'prev' | 'pager' | 'next' | 'jumper' | '->' | 'total' | 'slot'

//分页栏位置
export type pagePosition='left'|'right'|'center'

export interface PageConfig{
  currentPage:number //当前页
  pageSize:number //页面Size
  pageSizes:Array<number> //页面的可选Size
  total:number //总数
  disabled:boolean //是否禁用
  layout:string //组件布局
}


export const defaultPage = 1
export const defaultPageSize = 10
export const defaultPageSizes = [10, 20, 30, 40, 50]
export const defaultLayout = 'total, sizes, prev, pager, next, jumper'
export const defaultConfig:PageConfig = {
  currentPage:defaultPage,
  pageSize:defaultPageSize,
  pageSizes:defaultPageSizes,
  total:0,
  disabled:false,
  layout:defaultLayout
}

export const footerProps = {
  //操作按钮列表
  footerButtons:{
    type:Array as PropType<Array<OperButton>>,
    default:() => []
  },
  pageConfig:{
    type:Object as PropType<PageConfig>
  },
  showLoading:{
    type:Boolean,
    default:false
  }
}

export const footerEmits = ['sizeChange', 'currentChange', 'operation']